{{$menu="gallery"}}
{{include file="../00_subs/01_start.tpl"}}
{{include file="../00_subs/02_head.tpl"}}

<div class="bdbddd">
    <div class="gadiend-white bdbddd w100pc" style="height: 28px;border-top: 3px solid #fff;">
        <div class="lh28 pl12 pr">
            <b>Slider Management</b>
        </div>
    </div>
    <div class="pt4 pb4 pl4 pr4" style="min-height: 500px">
        <div>
        <input type="hidden" name="_id" id="_id" value="{{if isset($Data["OBJ"])}}{{$Data["OBJ"]->_id|escape:'html'}}{{/if}}"/>
        <table class="w720px">
            <tr>
                <td class="w100  blue">Album Name</td>
                <td>
                    <div class="pr10">
                        <input id="_name" name="_name" type="text"  class="classic-input w100pc"
                               value="{{if isset($Data["OBJ"])}}{{$Data["OBJ"]->_name|escape:'html'}}{{/if}}"
                               onblur="getAliasTo('#_name','#_alias')"
                               />
                    </div>
                </td>
            </tr>
            <tr>
                <td class="w100  blue">Alias</td>
                <td>
                    <div class="pr10">
                        <input id="_alias" name="_alias" type="text"  class="classic-input w100pc"
                               value="{{if isset($Data["OBJ"])}}{{$Data["OBJ"]->_alias|escape:'html'}}{{/if}}"
                               />
                    </div>
                </td>
            </tr>
            <tr>
                <td class="w100  blue">Thumb</td>
                <td>
                    <div class="pr10 pr">
                        <input id="_thumb" name="_thumb" type="text"  class="classic-input w100pc"
                               value="{{if isset($Data["OBJ"])}}{{$Data["OBJ"]->_thumb|escape:'html'}}{{/if}}"
                               />
                        <div class="pa hover50 icon16 chooseimage chooseimage_icon"
                             onclick="BrowseServer('_thumb');"
                             title="Choose image from my host"
                             >
                        </div>
                </td>
            </tr>
            <tr>
                <td class="w100  vtat"><label class="lh24">Description</label></td>
                <td>
                    <div class="pr10">
                        <textarea id="_des" name="_des" style="resize: vertical;" class="classic-input w100pc">{{if isset($Data["OBJ"])}}{{$Data["OBJ"]->_des|escape:'html'}}{{/if}}</textarea>
                    </div>
                </td>
            </tr>
        </table>
        </div>
        <div class=" grid_x">
            <div id="AlbumItems">
                {{if isset($Data["oGalleryDetail"])}}
                    {{foreach $Data["oGalleryDetail"] as $image}}
                        <div class="AlbumItem grid_5 mb4 mt4 ml4 mr4 bdccc gadiend-white">
                            <div class="pt1 pb1 pl1 pr1">
                                <div class="pl8 pt4 pb4 pr8 ovfh mt0 mb0 mr0 ml0 bdbccc">
                                    Album item
                                </div>
                                <div class="pa r8 t4">
                                    <span class="hover50" style="cursor: pointer" 
                                          title="Delete this item"
                                          onclick="DelAlbumItem(this)">✖</span>
                                </div>
                                <div class="pl4 pr4 pt4 pb4 mt0 mb0 ml0 mr0 ovfh pr" style="height: 200px">
                                    <img class="bgloadding32" alt="thumb" 
                                         title="{{$image->_title|escape:'html'}}"
                                         src="{{$image->_image|escape:'html'}}"/>
                                </div>
                            </div>
                        </div>
                    {{/foreach}}
                {{/if}}
            </div>
            <div class="clear"></div>
            <div class="w720px pt12 pl8">
                <div class="grid_14 pt12 pb12 mt12" style="border-top:1px dotted #ccc">
                    <div class="grid_3"><label class="lh24">Image</label></div>
                    <div class="grid_10 pr32">
                        <div class="pr10 pr">
                            <input id="txtAddImage" class="classic-input w100pc"/>
                            <div class="pa hover50 icon16 chooseimage chooseimage_icon"
                                onclick="BrowseServer( 'txtAddImage' );"
                                title="Choose image from my host"
                                >
                            </div>
                        </div>
                    </div>
                    <div class="grid_3 pt4"><label class="lh24">Link</label></div>
                    <div class="grid_10 pr32">
                        <div class="pr10 pr pt4">
                            <input id="txtImgDes" class="classic-input w100pc"/>
                        </div>
                    </div>
                    <div class="grid_4 prefix_3 pt4">
                        <button class="classic-button" onclick="AddAlbumItem()"><span>Add</span></button>
                        <button class="classic-button" onclick="SaveItem(false)"><span>Save</span></button>
                    </div>

                </div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <script src="{{base_url("backend/gallery/handleEvent")}}"></script>
    </div>
</div>

{{include file="../00_subs/03_foot.tpl"}}
{{include file="../00_subs/04_end.tpl"}}

